package com.fable.sp.core.domain;

import java.io.Serializable;

/**
 * .
 *
 * @author stormning on 16/7/30.
 */
public class Borders implements Serializable {

    private Border top;

    private Border right;

    private Border bottom;

    private Border left;

    public Border getTop() {
        return top;
    }

    public void setTop(Border top) {
        this.top = top;
    }

    public Border getRight() {
        return right;
    }

    public void setRight(Border right) {
        this.right = right;
    }

    public Border getBottom() {
        return bottom;
    }

    public void setBottom(Border bottom) {
        this.bottom = bottom;
    }

    public Border getLeft() {
        return left;
    }

    public void setLeft(Border left) {
        this.left = left;
    }


    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        Border top = getTop();
        if (top != null && top.getWidth() != null && top.getWidth() > 0) {
            builder.append("border-top:").append(top.toString());
        }
        Border right = getRight();
        if (right != null && right.getWidth() != null && right.getWidth() > 0) {
            builder.append("border-right:").append(right.toString());
        }

        Border bottom = getBottom();
        if (bottom != null && bottom.getWidth() != null && bottom.getWidth() > 0) {
            builder.append("border-bottom:").append(bottom.toString());
        }

        Border left = getLeft();
        if (left != null && left.getWidth() != null && left.getWidth() > 0) {
            builder.append("border-left:").append(left.toString());
        }
        return builder.toString();
    }
}
